<%@ page pageEncoding="UTF-8" %>
<%@ page import="buscar.Veiculo" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'veiculo.label', default: 'Veiculo')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="FinanciamentoController" action="index">Financiamento</g:link> </span>            	
            
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
            	
				            	
		
				
				<form action="compararVeiculos" name="compararVeiculosForm" method="post">
	                <table>
	                    <thead>
	                        <tr>
	                        
	                            <g:sortableColumn property="comparar" title="Comparar" /> 
	                            
	                            <g:sortableColumn property="id" title="${message(code: 'veiculo.id.label', default: 'Mais Informações')}" />
	                            
		                        <g:sortableColumn property="modelo" title="${message(code: 'veiculo.modelo.label', default: 'Modelo')}" />
	                        
	                            <g:sortableColumn property="marca" title="${message(code: 'veiculo.marca.label', default: 'Marca')}" />
	                                                   
	                            <g:sortableColumn property="ano" title="${message(code: 'veiculo.ano.label', default: 'Ano')}" />
	                        
	                            <g:sortableColumn property="valor" title="${message(code: 'veiculo.valor.label', default: 'Valor')}" />
	                        
	                            <g:sortableColumn property="cor" title="${message(code: 'veiculo.cor.label', default: 'Cor')}" />
	                            
	                            <g:sortableColumn property="direcaoHidraulica" title="Direção Hidráulica" />
	                            
	                            <g:sortableColumn property="arCondicionado" title="Ar Condicionado" />
	
	                            <g:sortableColumn property="vidrosEletricos" title="Vidros Elétricos" />
	
	                            <g:sortableColumn property="cambioAutomatico" title="Câmbio Automático" />
	
	                            <g:sortableColumn property="travasEletricas" title="Travas Elétricas" />
	
	                            <g:sortableColumn property="quatroPortas" title="Quatro Portas" />
	                            
	                            <g:sortableColumn property="som" title="Som" />
	                            
	                            <g:sortableColumn property="alarme" title="Alarme" />
	                            
	                            <g:sortableColumn property="sensorDeEstacionamento" title="Sensor de Estacionamento" />
	                            
	                            <g:sortableColumn property="quatroPorQuatro" title="4x4" />                       
	                        </tr>
	                    </thead>
	                    <tbody>
	                    
	                    <g:each in="${listaVeiculos}" status="i" var="veiculoInstance">
	                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
	                        
	                            <td><input type="checkbox" id="${veiculoInstance.id}" name="${veiculoInstance.id}" /></td>
			                          
			                    <td><g:link action="show" id="${veiculoInstance.id}">${fieldValue(bean: veiculoInstance, field: "id")}</g:link></td>
	                        
	                            <td>${fieldValue(bean: veiculoInstance, field: "modelo")}</td>
	                        
	                            <td>${fieldValue(bean: veiculoInstance, field: "marca")}</td>
	                        	                        
	                            <td>${fieldValue(bean: veiculoInstance, field: "ano")}</td>
	                        
	                            <td>${fieldValue(bean: veiculoInstance, field: "valor")}</td>
	                        
	                            <td>${fieldValue(bean: veiculoInstance, field: "cor")}</td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "direcaoHidraulica") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
									<g:if test='${fieldValue(bean: veiculoInstance, field: "arCondicionado") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
								</td>
								
								 <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "vidrosEletricos") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "cambioAutomatico") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "travasEletricas") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "quatroPortas") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "som") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "alarme") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                            </td>
	                            
	                            <td>
	                            	<g:if test='${fieldValue(bean: veiculoInstance, field: "sensorDeEstacionamento") == "true"}'>
	                            		Sim
	                            	</g:if>
	                            	<g:else>
	                            		Não
	                            	</g:else>
	                           	</td>
	                            
	                            <td>
									<g:if test='${fieldValue(bean: veiculoInstance, field: "quatroPorQuatro") == "true"}'>
	                            		Sim
	                            	</g:if>
		                            <g:else>
		                            	Não
		                            </g:else>
								
							</td>                          
	                        
	                        </tr>
	                    </g:each>
	                    </tbody>
	                </table>
	                <!-- 
					//========================================
					//			Tiago Portela de Souza 			
					//========================================
					-->
					<span class="menuButton"><input type="submit" value="Comparar Veiculos"></span>
					
					</form>
					
					
            </div>
            <div class="paginateButtons">
                
            </div>
        </div>
    </body>
</html>
